<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=utf-8" />
<title>Class: Ensembl::Core::Transcript</title>
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../../_index.html">Index (T)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../../Ensembl.html" title="Ensembl (module)">Ensembl</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Core.html" title="Ensembl::Core (module)">Core</a></span></span>
     &raquo; 
    <span class="title">Transcript</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Ensembl::Core::Transcript
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">ActiveRecord::Base</li>
          
            <li class="next"><span class='object_link'><a href="../DBRegistry/Base.html" title="Ensembl::DBRegistry::Base (class)">DBRegistry::Base</a></span></li>
          
            <li class="next"><span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></li>
          
            <li class="next">Ensembl::Core::Transcript</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
      <dt class="r2">Includes:</dt>
      <dd class="r2"><span class='object_link'><a href="Sliceable.html" title="Ensembl::Core::Sliceable (module)">Sliceable</a></span></dd>
      
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">lib/ensembl/core/transcript.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>
The Transcript class provides an interface to the transcript table. This
table contains mappings of transcripts for a Gene to a SeqRegion.
</p>
<p>
This class uses ActiveRecord to access data in the Ensembl database. See
the general documentation of the Ensembl module for more information on
what this means and what methods are available.
</p>
<p>
This class includes the mixin Sliceable, which means that it is mapped to a
SeqRegion object and a Slice can be created for objects of this class. See
Sliceable and Slice for more information.
</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <h3>Examples:</h3>
    
      <h4><div class='inline'></div></h4>
      <pre class="example code"><span class='comment val'>#TODO</span>
</pre>
    
  </div>

</div>

  
  
  
  
  
  
  
  
  
  
  
  
  

  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#find_all_by_stable_id-class_method" title="find_all_by_stable_id (class method)">+ (Object) <strong>find_all_by_stable_id</strong>(stable_id) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#find_all_by_stable_id class method returns an array of
transcripts with the given stable_id.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#find_by_stable_id-class_method" title="find_by_stable_id (class method)">+ (Object) <strong>find_by_stable_id</strong>(stable_id) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#find_by_stable_id class method fetches a Transcript object
based on its stable ID (i.e. the &quot;ENST&quot; accession number).
</p>
</div></span>
  
</li>

      
    </ul>
  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#cdna2genomic-instance_method" title="#cdna2genomic (instance method)">- (Integer) <strong>cdna2genomic</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#cdna2genomic method converts cDNA coordinates to genomic
coordinates for this transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#cds2genomic-instance_method" title="#cds2genomic (instance method)">- (Integer) <strong>cds2genomic</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#cds2genomic method converts CDS coordinates to genomic
coordinates for this transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#cds_seq-instance_method" title="#cds_seq (instance method)">- (Object) <strong>cds_seq</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#cds_seq method returns the coding sequence of the
transcript, i.e.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#coding_region_cdna_end-instance_method" title="#coding_region_cdna_end (instance method)">- (Object) <strong>coding_region_cdna_end</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#coding_region_cdna_end returns the stop position of the CDS
in cDNA coordinates.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#coding_region_cdna_start-instance_method" title="#coding_region_cdna_start (instance method)">- (Object) <strong>coding_region_cdna_start</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#coding_region_cdna_start returns the start position of the
CDS in cDNA coordinates.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#coding_region_genomic_end-instance_method" title="#coding_region_genomic_end (instance method)">- (Object) <strong>coding_region_genomic_end</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#coding_region_genomic_end returns the stop position of the
CDS in genomic coordinates.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#coding_region_genomic_start-instance_method" title="#coding_region_genomic_start (instance method)">- (Object) <strong>coding_region_genomic_start</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#coding_region_genomic_start returns the start position of
the CDS in genomic coordinates.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#display_label-instance_method" title="#display_label (instance method)">- (Object) <strong>display_label</strong> </a>
    

    
      (also: #display_name, #label, #name)
    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#display_label method returns the default name of the
transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#exon_for_cdna_position-instance_method" title="#exon_for_cdna_position (instance method)">- (Object) <strong>exon_for_cdna_position</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#exon_for_position identifies the exon that covers a given
position of the cDNA.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#exon_for_genomic_position-instance_method" title="#exon_for_genomic_position (instance method)">- (Object) <strong>exon_for_genomic_position</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#exon_for_position identifies the exon that covers a given
genomic position.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#exons-instance_method" title="#exons (instance method)">- (Array&lt;Exon&gt;) <strong>exons</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#exons method returns the exons for this transcript in the
order of their ranks in the exon_transcript table.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#five_prime_utr_seq-instance_method" title="#five_prime_utr_seq (instance method)">- (Object) <strong>five_prime_utr_seq</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#five_prime_utr_seq method returns the sequence of the
5&#8217;UTR of the transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#genomic2cdna-instance_method" title="#genomic2cdna (instance method)">- (Integer) <strong>genomic2cdna</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#genomic2cdna method converts genomic coordinates to cDNA
coordinates for this transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#genomic2cds-instance_method" title="#genomic2cds (instance method)">- (Integer) <strong>genomic2cds</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#genomic2cds method converts genomic coordinates to CDS
coordinates for this transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#genomic2pep-instance_method" title="#genomic2pep (instance method)">- (Integer) <strong>genomic2pep</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#genomic2pep method converts genomic coordinates to peptide
coordinates for this transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#introns-instance_method" title="#introns (instance method)">- (Array&lt;Intron&gt;) <strong>introns</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#introns methods returns the introns for this transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#pep2genomic-instance_method" title="#pep2genomic (instance method)">- (Integer) <strong>pep2genomic</strong>(pos) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#pep2genomic method converts peptide coordinates to genomic
coordinates for this transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#protein_seq-instance_method" title="#protein_seq (instance method)">- (Object) <strong>protein_seq</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#protein_seq method returns the sequence of the protein of
the transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#seq-instance_method" title="#seq (instance method)">- (Object) <strong>seq</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#seq method returns the full sequence of all concatenated
exons.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#stable_id-instance_method" title="#stable_id (instance method)">- (String) <strong>stable_id</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#stable_id method returns the stable ID of the transcript.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#three_prime_utr_seq-instance_method" title="#three_prime_utr_seq (instance method)">- (Object) <strong>three_prime_utr_seq</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
The Transcript#three_prime_utr_seq method returns the sequence of the
3&#8217;UTR of the transcript.
</p>
</div></span>
  
</li>

      
    </ul>
  


  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Sliceable.html" title="Ensembl::Core::Sliceable (module)">Sliceable</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Sliceable.html#length-instance_method" title="Ensembl::Core::Sliceable#length (method)">#length</a></span>, <span class='object_link'><a href="Sliceable.html#project-instance_method" title="Ensembl::Core::Sliceable#project (method)">#project</a></span>, <span class='object_link'><a href="Sliceable.html#slice-instance_method" title="Ensembl::Core::Sliceable#slice (method)">#slice</a></span>, <span class='object_link'><a href="Sliceable.html#start-instance_method" title="Ensembl::Core::Sliceable#start (method)">#start</a></span>, <span class='object_link'><a href="Sliceable.html#stop-instance_method" title="Ensembl::Core::Sliceable#stop (method)">#stop</a></span>, <span class='object_link'><a href="Sliceable.html#strand-instance_method" title="Ensembl::Core::Sliceable#strand (method)">#strand</a></span>, <span class='object_link'><a href="Sliceable.html#transform-instance_method" title="Ensembl::Core::Sliceable#transform (method)">#transform</a></span></p>

  
  
  
  
  
  
  
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="DBConnection.html" title="Ensembl::Core::DBConnection (class)">DBConnection</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="DBConnection.html#connect-class_method" title="Ensembl::Core::DBConnection.connect (method)">connect</a></span>, <span class='object_link'><a href="DBConnection.html#ensemblgenomes_connect-class_method" title="Ensembl::Core::DBConnection.ensemblgenomes_connect (method)">ensemblgenomes_connect</a></span></p>

  
  
  
  
  
  
  
  <h3 class="inherited">Methods inherited from <span class='object_link'><a href="../DBRegistry/Base.html" title="Ensembl::DBRegistry::Base (class)">DBRegistry::Base</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="../DBRegistry/Base.html#generic_connect-class_method" title="Ensembl::DBRegistry::Base.generic_connect (method)">generic_connect</a></span>, <span class='object_link'><a href="../DBRegistry/Base.html#get_info-class_method" title="Ensembl::DBRegistry::Base.get_info (method)">get_info</a></span>, <span class='object_link'><a href="../DBRegistry/Base.html#get_name_from_db-class_method" title="Ensembl::DBRegistry::Base.get_name_from_db (method)">get_name_from_db</a></span></p>

  

  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="find_all_by_stable_id-class_method">
  
    + (<tt>Object</tt>) <strong>find_all_by_stable_id</strong>(stable_id) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#find_all_by_stable_id class method returns an array of
transcripts with the given stable_id. If none were found, an empty array is
returned.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


142
143
144
145
146
147
148
149
150</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 142</span>

<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find_all_by_stable_id identifier id'>find_all_by_stable_id</span><span class='lparen token'>(</span><span class='stable_id identifier id'>stable_id</span><span class='rparen token'>)</span>
  <span class='answer identifier id'>answer</span> <span class='assign token'>=</span> <span class='Array constant id'>Array</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
  <span class='transcript_stable_id_objects identifier id'>transcript_stable_id_objects</span> <span class='assign token'>=</span> <span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='TranscriptStableId constant id'>TranscriptStableId</span><span class='dot token'>.</span><span class='find_all_by_stable_id identifier id'>find_all_by_stable_id</span><span class='lparen token'>(</span><span class='stable_id identifier id'>stable_id</span><span class='rparen token'>)</span>
  <span class='transcript_stable_id_objects identifier id'>transcript_stable_id_objects</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='transcript_stable_id_object identifier id'>transcript_stable_id_object</span><span class='bitor op'>|</span>
    <span class='answer identifier id'>answer</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='Ensembl constant id'>Ensembl</span><span class='colon2 op'>::</span><span class='Core constant id'>Core</span><span class='colon2 op'>::</span><span class='Transcript constant id'>Transcript</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='transcript_stable_id_object identifier id'>transcript_stable_id_object</span><span class='dot token'>.</span><span class='transcript_id identifier id'>transcript_id</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
  <span class='end end kw'>end</span>

  <span class='return return kw'>return</span> <span class='answer identifier id'>answer</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="find_by_stable_id-class_method">
  
    + (<tt>Object</tt>) <strong>find_by_stable_id</strong>(stable_id) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#find_by_stable_id class method fetches a Transcript object
based on its stable ID (i.e. the &quot;ENST&quot; accession number). If the
name is not found, it returns nil.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


154
155
156
157
158
159
160
161</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 154</span>

<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='find_by_stable_id identifier id'>find_by_stable_id</span><span class='lparen token'>(</span><span class='stable_id identifier id'>stable_id</span><span class='rparen token'>)</span>
  <span class='transcript_stable_id identifier id'>transcript_stable_id</span> <span class='assign token'>=</span> <span class='TranscriptStableId constant id'>TranscriptStableId</span><span class='dot token'>.</span><span class='find_by_stable_id identifier id'>find_by_stable_id</span><span class='lparen token'>(</span><span class='stable_id identifier id'>stable_id</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='transcript_stable_id identifier id'>transcript_stable_id</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='return return kw'>return</span> <span class='nil nil kw'>nil</span>
  <span class='else else kw'>else</span>
    <span class='return return kw'>return</span> <span class='transcript_stable_id identifier id'>transcript_stable_id</span><span class='dot token'>.</span><span class='transcript identifier id'>transcript</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="cdna2genomic-instance_method">
  
    - (<tt>Integer</tt>) <strong>cdna2genomic</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#cdna2genomic method converts cDNA coordinates to genomic
coordinates for this transcript.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>pos</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the cDNA
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the genomic DNA
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 318</span>

<span class='def def kw'>def</span> <span class='cdna2genomic identifier id'>cdna2genomic</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='comment val'>#FIXME: Still have to check for when pos is outside of scope of cDNA.</span>
  <span class='comment val'># Identify the exon we're looking at.</span>
  <span class='exon_with_target identifier id'>exon_with_target</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exon_for_cdna_position identifier id'>exon_for_cdna_position</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  
  <span class='accumulated_position identifier id'>accumulated_position</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
  <span class='ex identifier id'>ex</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='sort_by identifier id'>sort_by</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='e identifier id'>e</span><span class='bitor op'>|</span> <span class='e identifier id'>e</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span><span class='rbrace token'>}</span>
  <span class='ex identifier id'>ex</span><span class='dot token'>.</span><span class='reverse! fid id'>reverse!</span> <span class='if if_mod kw'>if</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='strand identifier id'>strand</span> <span class='eq op'>==</span> <span class='integer val'>-1</span>
  <span class='ex identifier id'>ex</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='bitor op'>|</span>  
    <span class='if if kw'>if</span> <span class='exon identifier id'>exon</span> <span class='eq op'>==</span> <span class='exon_with_target identifier id'>exon_with_target</span>
      <span class='length_to_be_taken_from_exon identifier id'>length_to_be_taken_from_exon</span> <span class='assign token'>=</span> <span class='pos identifier id'>pos</span> <span class='minus op'>-</span> <span class='lparen token'>(</span><span class='accumulated_position identifier id'>accumulated_position</span> <span class='plus op'>+</span> <span class='integer val'>1</span><span class='rparen token'>)</span>
      <span class='if if kw'>if</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='strand identifier id'>strand</span> <span class='eq op'>==</span> <span class='integer val'>-1</span>
        <span class='return return kw'>return</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='seq_region_end identifier id'>seq_region_end</span> <span class='minus op'>-</span> <span class='length_to_be_taken_from_exon identifier id'>length_to_be_taken_from_exon</span>
      <span class='else else kw'>else</span>
        <span class='return return kw'>return</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span> <span class='plus op'>+</span> <span class='length_to_be_taken_from_exon identifier id'>length_to_be_taken_from_exon</span>
      <span class='end end kw'>end</span>
    <span class='else else kw'>else</span>
      <span class='accumulated_position identifier id'>accumulated_position</span> <span class='opasgn op'>+=</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='length identifier id'>length</span> 
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="cds2genomic-instance_method">
  
    - (<tt>Integer</tt>) <strong>cds2genomic</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#cds2genomic method converts CDS coordinates to genomic
coordinates for this transcript.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>pos</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the CDS
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the genomic DNA
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


345
346
347</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 345</span>

<span class='def def kw'>def</span> <span class='cds2genomic identifier id'>cds2genomic</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='cdna2genomic identifier id'>cdna2genomic</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span> <span class='plus op'>+</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='coding_region_cdna_start identifier id'>coding_region_cdna_start</span><span class='rparen token'>)</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="cds_seq-instance_method">
  
    - (<tt>Object</tt>) <strong>cds_seq</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#cds_seq method returns the coding sequence of the
transcript, i.e. the concatenated sequence of all exons minus the UTRs.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


189
190
191
192
193</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 189</span>

<span class='def def kw'>def</span> <span class='cds_seq identifier id'>cds_seq</span>
  <span class='cds_length identifier id'>cds_length</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='coding_region_cdna_end identifier id'>coding_region_cdna_end</span> <span class='minus op'>-</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='coding_region_cdna_start identifier id'>coding_region_cdna_start</span> <span class='plus op'>+</span> <span class='integer val'>1</span>
  
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='seq identifier id'>seq</span><span class='lbrack token'>[</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='coding_region_cdna_start identifier id'>coding_region_cdna_start</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rparen token'>)</span><span class='comma token'>,</span> <span class='cds_length identifier id'>cds_length</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="coding_region_cdna_end-instance_method">
  
    - (<tt>Object</tt>) <strong>coding_region_cdna_end</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#coding_region_cdna_end returns the stop position of the CDS
in cDNA coordinates. Note that, in contrast to the
Transcript#coding_region_genomic_end, the CDS start position is
<em>always</em> at the border of the 3&#8217;UTR. So for genes on the
reverse strand, the CDS start position in cDNA coordinates will be
&#8217;&#8217;right&#8217;&#8217; of the CDS stop position.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


270
271
272
273
274
275
276
277
278
279
280
281</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 270</span>

<span class='def def kw'>def</span> <span class='coding_region_cdna_end identifier id'>coding_region_cdna_end</span>
  <span class='answer identifier id'>answer</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
  
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='bitor op'>|</span>
    <span class='if if kw'>if</span> <span class='exon identifier id'>exon</span> <span class='eq op'>==</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='end_exon identifier id'>end_exon</span>
      <span class='answer identifier id'>answer</span> <span class='opasgn op'>+=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='seq_end identifier id'>seq_end</span>
      <span class='return return kw'>return</span> <span class='answer identifier id'>answer</span>
    <span class='else else kw'>else</span>
      <span class='answer identifier id'>answer</span> <span class='opasgn op'>+=</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='length identifier id'>length</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="coding_region_cdna_start-instance_method">
  
    - (<tt>Object</tt>) <strong>coding_region_cdna_start</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#coding_region_cdna_start returns the start position of the
CDS in cDNA coordinates. Note that, in contrast to the
Transcript#coding_region_genomic_start, the CDS start position is
<em>always</em> at the border of the 5&#8217;UTR. So for genes on the
reverse strand, the CDS start position in cDNA coordinates will be
&#8217;&#8217;right&#8217;&#8217; of the CDS stop position.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


250
251
252
253
254
255
256
257
258
259
260
261
262</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 250</span>

<span class='def def kw'>def</span> <span class='coding_region_cdna_start identifier id'>coding_region_cdna_start</span>
  <span class='answer identifier id'>answer</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
  
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='bitor op'>|</span>
    <span class='if if kw'>if</span> <span class='exon identifier id'>exon</span> <span class='eq op'>==</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='start_exon identifier id'>start_exon</span>
      <span class='answer identifier id'>answer</span> <span class='opasgn op'>+=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='seq_start identifier id'>seq_start</span>
      <span class='return return kw'>return</span> <span class='answer identifier id'>answer</span>
    <span class='else else kw'>else</span>
      <span class='answer identifier id'>answer</span> <span class='opasgn op'>+=</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='length identifier id'>length</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="coding_region_genomic_end-instance_method">
  
    - (<tt>Object</tt>) <strong>coding_region_genomic_end</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#coding_region_genomic_end returns the stop position of the
CDS in genomic coordinates. Note that, in contrast to
Transcript#coding_region_cdna_end, the CDS stop position is <em>always</em>
&#8217;&#8217;right&#8217;&#8217; of the start position. So for transcripts
on the reverse strand, the CDS stop position is at the border of the
5&#8217;UTR instead of the 3&#8217;UTR.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


235
236
237
238
239
240
241
242</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 235</span>

<span class='def def kw'>def</span> <span class='coding_region_genomic_end identifier id'>coding_region_genomic_end</span>
  <span class='strand identifier id'>strand</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='start_exon identifier id'>start_exon</span><span class='dot token'>.</span><span class='seq_region_strand identifier id'>seq_region_strand</span>
  <span class='if if kw'>if</span> <span class='strand identifier id'>strand</span> <span class='eq op'>==</span> <span class='integer val'>1</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='end_exon identifier id'>end_exon</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span> <span class='plus op'>+</span> <span class='lparen token'>(</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='seq_end identifier id'>seq_end</span> <span class='minus op'>-</span> <span class='integer val'>1</span> <span class='rparen token'>)</span>
  <span class='else else kw'>else</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='start_exon identifier id'>start_exon</span><span class='dot token'>.</span><span class='seq_region_end identifier id'>seq_region_end</span> <span class='minus op'>-</span> <span class='lparen token'>(</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='seq_start identifier id'>seq_start</span> <span class='minus op'>-</span> <span class='integer val'>1</span> <span class='rparen token'>)</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="coding_region_genomic_start-instance_method">
  
    - (<tt>Object</tt>) <strong>coding_region_genomic_start</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#coding_region_genomic_start returns the start position of
the CDS in genomic coordinates. Note that, in contrast to
Transcript#coding_region_cdna_start, the CDS start position is
<em>always</em> &#8217;&#8217;left&#8217;&#8217; of the end position. So
for transcripts on the reverse strand, the CDS start position is at the
border of the 3&#8217;UTR instead of the 5&#8217;UTR.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


220
221
222
223
224
225
226
227</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 220</span>

<span class='def def kw'>def</span> <span class='coding_region_genomic_start identifier id'>coding_region_genomic_start</span>
  <span class='strand identifier id'>strand</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='start_exon identifier id'>start_exon</span><span class='dot token'>.</span><span class='seq_region_strand identifier id'>seq_region_strand</span>
  <span class='if if kw'>if</span> <span class='strand identifier id'>strand</span> <span class='eq op'>==</span> <span class='integer val'>1</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='start_exon identifier id'>start_exon</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span> <span class='plus op'>+</span> <span class='lparen token'>(</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='seq_start identifier id'>seq_start</span> <span class='minus op'>-</span> <span class='integer val'>1</span> <span class='rparen token'>)</span>
  <span class='else else kw'>else</span>
    <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='end_exon identifier id'>end_exon</span><span class='dot token'>.</span><span class='seq_region_end identifier id'>seq_region_end</span> <span class='minus op'>-</span> <span class='lparen token'>(</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='translation identifier id'>translation</span><span class='dot token'>.</span><span class='seq_end identifier id'>seq_end</span> <span class='minus op'>-</span> <span class='integer val'>1</span> <span class='rparen token'>)</span>
  <span class='end end kw'>end</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="display_label-instance_method">
  
    - (<tt>Object</tt>) <strong>display_label</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='display_name-instance_method'>display_name</span>, <span id='label-instance_method'>label</span>, <span id='name-instance_method'>name</span></span>
    </span>
  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#display_label method returns the default name of the
transcript.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


132
133
134</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 132</span>

<span class='def def kw'>def</span> <span class='display_label identifier id'>display_label</span>
  <span class='return return kw'>return</span> <span class='Xref constant id'>Xref</span><span class='dot token'>.</span><span class='find identifier id'>find</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='display_xref_id identifier id'>display_xref_id</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='display_label identifier id'>display_label</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="exon_for_cdna_position-instance_method">
  
    - (<tt>Object</tt>) <strong>exon_for_cdna_position</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#exon_for_position identifies the exon that covers a given
position of the cDNA.
</p>


  </div>
</div>
<div class="tags">
  <h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>RuntimeError</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


300
301
302
303
304
305
306
307
308
309
310
311</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 300</span>

<span class='def def kw'>def</span> <span class='exon_for_cdna_position identifier id'>exon_for_cdna_position</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='comment val'># FIXME: Still have to check for when pos is outside of scope of cDNA.</span>
  <span class='accumulated_exon_length identifier id'>accumulated_exon_length</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
  
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='bitor op'>|</span>
    <span class='accumulated_exon_length identifier id'>accumulated_exon_length</span> <span class='opasgn op'>+=</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='length identifier id'>length</span>
    <span class='if if kw'>if</span> <span class='accumulated_exon_length identifier id'>accumulated_exon_length</span> <span class='gt op'>&gt;</span> <span class='pos identifier id'>pos</span>
      <span class='return return kw'>return</span> <span class='exon identifier id'>exon</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  <span class='raise identifier id'>raise</span> <span class='RuntimeError constant id'>RuntimeError</span><span class='comma token'>,</span> <span class='string val'>&quot;Position outside of cDNA scope&quot;</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="exon_for_genomic_position-instance_method">
  
    - (<tt>Object</tt>) <strong>exon_for_genomic_position</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#exon_for_position identifies the exon that covers a given
genomic position. Returns the exon object, or nil if in intron.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


286
287
288
289
290
291
292
293
294
295
296</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 286</span>

<span class='def def kw'>def</span> <span class='exon_for_genomic_position identifier id'>exon_for_genomic_position</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='if if kw'>if</span> <span class='pos identifier id'>pos</span> <span class='lt op'>&lt;</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span> <span class='or or kw'>or</span> <span class='pos identifier id'>pos</span> <span class='gt op'>&gt;</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='seq_region_end identifier id'>seq_region_end</span>
    <span class='raise identifier id'>raise</span> <span class='RuntimeError constant id'>RuntimeError</span><span class='comma token'>,</span> <span class='string val'>&quot;Position has to be within transcript&quot;</span>
  <span class='end end kw'>end</span>
  <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='bitor op'>|</span>
    <span class='if if kw'>if</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='start identifier id'>start</span> <span class='leq op'>&lt;=</span> <span class='pos identifier id'>pos</span> <span class='and and kw'>and</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='stop identifier id'>stop</span> <span class='geq op'>&gt;=</span> <span class='pos identifier id'>pos</span>
      <span class='return return kw'>return</span> <span class='exon identifier id'>exon</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  <span class='return return kw'>return</span> <span class='nil nil kw'>nil</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="exons-instance_method">
  
    - (<tt>Array&lt;<span class='object_link'><a href="Exon.html" title="Ensembl::Core::Exon (class)">Exon</a></span>&gt;</tt>) <strong>exons</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#exons method returns the exons for this transcript in the
order of their ranks in the exon_transcript table.
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Exon.html" title="Ensembl::Core::Exon (class)">Exon</a></span>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Sorted array of Exon objects
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


101
102
103
104
105
106</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 101</span>

<span class='def def kw'>def</span> <span class='exons identifier id'>exons</span>
  <span class='if if kw'>if</span> <span class='@exons ivar id'>@exons</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='@exons ivar id'>@exons</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exon_transcripts identifier id'>exon_transcripts</span><span class='lparen token'>(</span><span class='symbol val'>:include</span> <span class='assign token'>=</span><span class='gt op'>&gt;</span> <span class='lbrack token'>[</span><span class='symbol val'>:exons</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='sort_by identifier id'>sort_by</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='et identifier id'>et</span><span class='bitor op'>|</span> <span class='et identifier id'>et</span><span class='dot token'>.</span><span class='rank identifier id'>rank</span><span class='dot token'>.</span><span class='to_i identifier id'>to_i</span><span class='rbrace token'>}</span><span class='dot token'>.</span><span class='collect identifier id'>collect</span><span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='et identifier id'>et</span><span class='bitor op'>|</span> <span class='et identifier id'>et</span><span class='dot token'>.</span><span class='exon identifier id'>exon</span><span class='rbrace token'>}</span>
  <span class='end end kw'>end</span>
  <span class='return return kw'>return</span> <span class='@exons ivar id'>@exons</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="five_prime_utr_seq-instance_method">
  
    - (<tt>Object</tt>) <strong>five_prime_utr_seq</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#five_prime_utr_seq method returns the sequence of the
5&#8217;UTR of the transcript.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


197
198
199</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 197</span>

<span class='def def kw'>def</span> <span class='five_prime_utr_seq identifier id'>five_prime_utr_seq</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='seq identifier id'>seq</span><span class='lbrack token'>[</span><span class='integer val'>0</span><span class='comma token'>,</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='coding_region_cdna_start identifier id'>coding_region_cdna_start</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="genomic2cdna-instance_method">
  
    - (<tt>Integer</tt>) <strong>genomic2cdna</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#genomic2cdna method converts genomic coordinates to cDNA
coordinates for this transcript.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>pos</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the genomic DNA
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the cDNA
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 363</span>

<span class='def def kw'>def</span> <span class='genomic2cdna identifier id'>genomic2cdna</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='comment val'>#FIXME: Still have to check for when pos is outside of scope of cDNA.</span>
  <span class='comment val'># Identify the exon we're looking at.</span>
  <span class='exon_with_target identifier id'>exon_with_target</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exon_for_genomic_position identifier id'>exon_for_genomic_position</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  
  <span class='accumulated_position identifier id'>accumulated_position</span> <span class='assign token'>=</span> <span class='integer val'>0</span>
  <span class='ex identifier id'>ex</span> <span class='assign token'>=</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='sort_by identifier id'>sort_by</span> <span class='lbrace token'>{</span><span class='bitor op'>|</span><span class='e identifier id'>e</span><span class='bitor op'>|</span> <span class='e identifier id'>e</span><span class='dot token'>.</span><span class='seq_region_start identifier id'>seq_region_start</span><span class='rbrace token'>}</span>
  <span class='ex identifier id'>ex</span><span class='dot token'>.</span><span class='reverse! fid id'>reverse!</span> <span class='if if_mod kw'>if</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='strand identifier id'>strand</span> <span class='eq op'>==</span> <span class='integer val'>-1</span>
  <span class='ex identifier id'>ex</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='bitor op'>|</span>
    <span class='if if kw'>if</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='stable_id identifier id'>stable_id</span> <span class='eq op'>==</span> <span class='exon_with_target identifier id'>exon_with_target</span><span class='dot token'>.</span><span class='stable_id identifier id'>stable_id</span>
      <span class='if if kw'>if</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='strand identifier id'>strand</span> <span class='eq op'>==</span> <span class='integer val'>1</span>
        <span class='accumulated_position identifier id'>accumulated_position</span> <span class='opasgn op'>+=</span> <span class='lparen token'>(</span> <span class='pos identifier id'>pos</span> <span class='minus op'>-</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='start identifier id'>start</span><span class='rparen token'>)</span> <span class='plus op'>+</span><span class='integer val'>1</span>
      <span class='else else kw'>else</span>
        <span class='accumulated_position identifier id'>accumulated_position</span> <span class='opasgn op'>+=</span> <span class='lparen token'>(</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='stop identifier id'>stop</span> <span class='minus op'>-</span> <span class='pos identifier id'>pos</span> <span class='rparen token'>)</span> <span class='plus op'>+</span><span class='integer val'>1</span>
      <span class='end end kw'>end</span>  
      <span class='return return kw'>return</span> <span class='accumulated_position identifier id'>accumulated_position</span>
    <span class='else else kw'>else</span>
        <span class='accumulated_position identifier id'>accumulated_position</span> <span class='opasgn op'>+=</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='length identifier id'>length</span> 
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  <span class='return return kw'>return</span> <span class='RuntimeError constant id'>RuntimeError</span><span class='comma token'>,</span> <span class='string val'>&quot;Position outside of cDNA scope&quot;</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="genomic2cds-instance_method">
  
    - (<tt>Integer</tt>) <strong>genomic2cds</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#genomic2cds method converts genomic coordinates to CDS
coordinates for this transcript.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>pos</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the genomic DNA
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the CDS
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


391
392
393</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 391</span>

<span class='def def kw'>def</span> <span class='genomic2cds identifier id'>genomic2cds</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='genomic2cdna identifier id'>genomic2cdna</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span> <span class='minus op'>-</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='coding_region_cdna_start identifier id'>coding_region_cdna_start</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="genomic2pep-instance_method">
  
    - (<tt>Integer</tt>) <strong>genomic2pep</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#genomic2pep method converts genomic coordinates to peptide
coordinates for this transcript.
</p>
<p>
<b>Arguments</b>:
</p>
<ul>
<li>pos:: position on the chromosome (required)

</li>
</ul>
<p>
<b>Returns</b>::
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>pos</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Base position on the genomic DNA
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Aminoacid position in the protein
</p>
</div>
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NotImplementedError</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


403
404
405</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 403</span>

<span class='def def kw'>def</span> <span class='genomic2pep identifier id'>genomic2pep</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='raise identifier id'>raise</span> <span class='NotImplementedError constant id'>NotImplementedError</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="introns-instance_method">
  
    - (<tt>Array&lt;<span class='object_link'><a href="Intron.html" title="Ensembl::Core::Intron (class)">Intron</a></span>&gt;</tt>) <strong>introns</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#introns methods returns the introns for this transcript
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;<span class='object_link'><a href="Intron.html" title="Ensembl::Core::Intron (class)">Intron</a></span>&gt;</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Sorted array of Intron objects
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


111
112
113
114
115
116
117
118
119
120
121
122</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 111</span>

<span class='def def kw'>def</span> <span class='introns identifier id'>introns</span>
  <span class='if if kw'>if</span> <span class='@introns ivar id'>@introns</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='@introns ivar id'>@introns</span> <span class='assign token'>=</span> <span class='Array constant id'>Array</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
    <span class='if if kw'>if</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='length identifier id'>length</span> <span class='gt op'>&gt;</span> <span class='integer val'>1</span>
      <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='each_with_index identifier id'>each_with_index</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='comma token'>,</span> <span class='index identifier id'>index</span><span class='bitor op'>|</span>
        <span class='next next kw'>next</span> <span class='if if_mod kw'>if</span> <span class='index identifier id'>index</span> <span class='eq op'>==</span> <span class='integer val'>0</span>
        <span class='@introns ivar id'>@introns</span><span class='dot token'>.</span><span class='push identifier id'>push</span><span class='lparen token'>(</span><span class='Intron constant id'>Intron</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='lbrack token'>[</span><span class='index identifier id'>index</span> <span class='minus op'>-</span> <span class='integer val'>1</span><span class='rbrack token'>]</span><span class='comma token'>,</span> <span class='exon identifier id'>exon</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
      <span class='end end kw'>end</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  <span class='return return kw'>return</span> <span class='@introns ivar id'>@introns</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="pep2genomic-instance_method">
  
    - (<tt>Integer</tt>) <strong>pep2genomic</strong>(pos) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#pep2genomic method converts peptide coordinates to genomic
coordinates for this transcript.
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
        <span class='name'>pos</span>
      
      
      
        &mdash;
        <div class='inline'><p>
Aminoacid position on the protein
</p>
</div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Integer</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Position on the genomic DNA
</p>
</div>
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
        <span class='type'>(<tt>NotImplementedError</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


354
355
356</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 354</span>

<span class='def def kw'>def</span> <span class='pep2genomic identifier id'>pep2genomic</span><span class='lparen token'>(</span><span class='pos identifier id'>pos</span><span class='rparen token'>)</span>
  <span class='raise identifier id'>raise</span> <span class='NotImplementedError constant id'>NotImplementedError</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="protein_seq-instance_method">
  
    - (<tt>Object</tt>) <strong>protein_seq</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#protein_seq method returns the sequence of the protein of
the transcript.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


209
210
211</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 209</span>

<span class='def def kw'>def</span> <span class='protein_seq identifier id'>protein_seq</span>
  <span class='return return kw'>return</span> <span class='Bio constant id'>Bio</span><span class='colon2 op'>::</span><span class='Sequence constant id'>Sequence</span><span class='colon2 op'>::</span><span class='NA constant id'>NA</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='cds_seq identifier id'>cds_seq</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='translate identifier id'>translate</span><span class='dot token'>.</span><span class='seq identifier id'>seq</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="seq-instance_method">
  
    - (<tt>Object</tt>) <strong>seq</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#seq method returns the full sequence of all concatenated
exons.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


177
178
179
180
181
182
183
184
185</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 177</span>

<span class='def def kw'>def</span> <span class='seq identifier id'>seq</span>
  <span class='if if kw'>if</span> <span class='@seq ivar id'>@seq</span><span class='dot token'>.</span><span class='nil? fid id'>nil?</span>
    <span class='@seq ivar id'>@seq</span> <span class='assign token'>=</span> <span class='string val'>''</span>
    <span class='self self kw'>self</span><span class='dot token'>.</span><span class='exons identifier id'>exons</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='exon identifier id'>exon</span><span class='bitor op'>|</span>
      <span class='@seq ivar id'>@seq</span> <span class='opasgn op'>+=</span> <span class='exon identifier id'>exon</span><span class='dot token'>.</span><span class='seq identifier id'>seq</span>
    <span class='end end kw'>end</span>
  <span class='end end kw'>end</span>
  <span class='return return kw'>return</span> <span class='@seq ivar id'>@seq</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="stable_id-instance_method">
  
    - (<tt>String</tt>) <strong>stable_id</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#stable_id method returns the stable ID of the transcript.
</p>


  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
      
        &mdash;
        <div class='inline'><p>
Ensembl stable ID of the transcript.
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


127
128
129</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 127</span>

<span class='def def kw'>def</span> <span class='stable_id identifier id'>stable_id</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='transcript_stable_id identifier id'>transcript_stable_id</span><span class='dot token'>.</span><span class='stable_id identifier id'>stable_id</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="three_prime_utr_seq-instance_method">
  
    - (<tt>Object</tt>) <strong>three_prime_utr_seq</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
The Transcript#three_prime_utr_seq method returns the sequence of the
3&#8217;UTR of the transcript.
</p>


  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


203
204
205</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/ensembl/core/transcript.rb', line 203</span>

<span class='def def kw'>def</span> <span class='three_prime_utr_seq identifier id'>three_prime_utr_seq</span>
  <span class='return return kw'>return</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='seq identifier id'>seq</span><span class='lbrack token'>[</span><span class='self self kw'>self</span><span class='dot token'>.</span><span class='coding_region_cdna_end identifier id'>coding_region_cdna_end</span><span class='dot2 op'>..</span><span class='integer val'>-1</span><span class='rbrack token'>]</span>
<span class='end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Wed Dec 15 19:18:15 2010 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.6.3 (ruby-1.8.7).
</div>

  </body>
</html>